package com.community.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.common.base.BaseServiceImpl;
import com.community.mapper.OwnerDAO;
import com.community.dto.OwnerDTO;
import com.community.po.OwnerPO;
import com.community.service.OwnerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ToDo:
 * @Author：高尚磊
 * @date: 2024/6/4 9:00
 */
@Slf4j
@Service
@Transactional
public class OwnerServiceImpl extends BaseServiceImpl<OwnerDAO,OwnerPO,OwnerDTO> implements OwnerService {
   @Autowired(required = false)
   private OwnerDAO owner;
   @Override
    public List<OwnerPO> find() {
        return owner.find();
    }

    @Override
    public int insert(OwnerPO ownerPO) {
        return owner.insert(ownerPO);
    }

    @Override
    public OwnerPO getByTel(String phone) {
        return this.baseMapper.getByTel(phone);
    }

    @Override
    public int getCount() {
        return this.baseMapper.getCount();
    }

//    @Override
//    public OwnerPO getByTel(Long phone) {
//        return this.baseMapper.getByTel(phone);
//    }

//    @Override
//    public Page<OwnerDTO> getAllOwner(OwnerDTO ownerDTO) {
//        return owner.getAllOwner(ownerDTO);
//    }

//    @Override
//    public OwnerPO getOwnerId(Long id) {
//        return owner.getById(id);
//    }

    @Override
    public OwnerPO getById(Long id) {
        return  this.baseMapper.getById(id);
    }

    @Override
    public Page<?> page(OwnerDTO ownerDTO) {
        return this.baseMapper.page(ownerDTO);
    }
//    @Resource
//    private OwnerDAO ownerDAO;
//    public Page<?> page(OwnerDTO ownerDTO){
//        return this.baseMapper.page(ownerDTO);
//    }

}
